<?php

namespace App\Models\Webserver;

use Illuminate\Database\Eloquent\Model;

/**
 * App\Models\Webserver\News
 *
 * @property int $id
 * @property string $title
 * @property string $slug
 * @property string $text
 * @property int $account_id
 * @property \Carbon\Carbon $created_at
 * @property \Carbon\Carbon $updated_at
 * @property-read \App\Models\Loginserver\AccountData $creator
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Webserver\News whereAccountId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Webserver\News whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Webserver\News whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Webserver\News whereSlug($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Webserver\News whereText($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Webserver\News whereTitle($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Webserver\News whereUpdatedAt($value)
 * @mixin \Eloquent
 */
class News extends Model {

    protected $table        = 'news';
    protected $connection   = 'webserver';
    protected $fillable     = ['title', 'slug', 'text', 'account_id'];

    public function creator(){
        return $this->belongsTo('App\Models\Loginserver\AccountData', 'account_id', 'id');
    }

}
